using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;

namespace Core.Editor
{
    public class CaptureShot
    {
        [MenuItem("HotCore/工具/屏幕截图", priority = 301)]
        public static void TakeShot()
        {
            var filePath = Application.dataPath + "/../Captures";
            if (!Directory.Exists(filePath))
                Directory.CreateDirectory(filePath);
            var files = Directory.GetDirectories(Application.dataPath + "/../Captures");
            string fileName = $"{Application.dataPath}/../Captures/{files.Length + 1}.png";
            UnityEngine.ScreenCapture.CaptureScreenshot(fileName);
        }
    }
}